<DIV class="panelNode panelNode-script contextUID=37307" active="true"> <DIV class="sourceBox" collapsed="false">   <DIV class="sourceRow" exechecked="true">   <A class="sourceLine">  1</A><SPAN class="sourceRowText"><SPAN class="comment">// Create a predicate function that tests a string againsts a given</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true">   <A class="sourceLine">  2</A><SPAN class="sourceRowText"><SPAN class="comment">// regular expression.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">  3</A><SPAN class="sourceRowText"><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">matcher</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">regexp</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">  4</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">function</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">value</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">regexp</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">test</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">value</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">  5</A><SPAN class="sourceRowText"><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">  6</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">  7</A><SPAN class="sourceRowText"><SPAN class="comment">/* Tokenizer for JavaScript code */</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">  8</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">  9</A><SPAN class="sourceRowText"><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">tokenizeJavaScript</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">function</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 10</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// Some helper regexp matchers.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 11</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">isOperatorChar</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">matcher</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="regexp">/[\+\-\*\&amp;\%\/=&lt;&gt;!\?]/</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 12</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">isWhiteSpace</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 13</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// In our scheme newlines are no whitespace (they are another</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 14</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// special case).</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 15</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">!=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"\n"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">realWhiteSpace</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">test</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 16</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 17</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 18</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// A map of JavaScript's keywords.</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 19</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">keywords</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">function</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 20</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">type</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">style</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 21</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">{</SPAN><SPAN class="property">type</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">type</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">style</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">style</SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 22</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 23</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// keywords that take a parenthised expression, and then a</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 24</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// statement (if)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 25</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">keywordA</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"keyword a"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 26</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// keywords that take just a statement (else)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 27</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">keywordB</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"keyword b"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 28</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// keywords that optionally take an expression, and form a</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 29</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// statement (return)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 30</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">keywordC</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"keyword c"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 31</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">operator</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"operator"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 32</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">atom</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"atom"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"atom"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 33</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 34</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"if"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordA</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"switch"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordA</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"while"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordA</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"with"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordA</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 35</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"else"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordB</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"do"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordB</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"try"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordB</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"finally"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordB</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 36</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"return"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"break"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"continue"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"new"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"delete"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"throw"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywordC</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 37</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"in"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">operator</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"typeof"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">operator</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"instanceof"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">operator</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 38</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"var"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"var"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"function"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"function"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"catch"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"catch"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 39</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"for"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"for"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"case"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"case"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 40</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="string">"true"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"false"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"null"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"undefined"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"NaN"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"Infinity"</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">atom</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 41</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 42</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 43</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 44</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// This function produces a MochiKit-style iterator that tokenizes</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 45</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// the output of the given stringstream (see stringstream.js).</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 46</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// Tokens are objects with a type, style, and value property. The</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 47</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// value contains the textual content of the token. Because this may</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 48</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// include trailing whitespace (for efficiency reasons), some</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 49</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// tokens, such a variable names, also have a name property</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 50</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="comment">// containing their actual textual value.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 51</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">function</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">source</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 52</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Produce a value to return. Automatically skips and includes any</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 53</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// whitespace. The base argument is prepended to the value</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 54</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// property and assigned to the name property -- this is used when</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 55</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// the caller has already extracted the text from the stream</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 56</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// himself.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 57</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">type</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">style</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">base</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 58</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isWhiteSpace</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 59</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">value</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">{</SPAN><SPAN class="property">type</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">type</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">style</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">style</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">value</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">base</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">?</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">base</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">+</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">get</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">get</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 60</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">base</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">value</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">name</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">base</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 61</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">value</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 62</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 63</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 64</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Advance the stream until the given character (not preceded by a</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 65</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// backslash) is encountered (or a newline is found).</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 66</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">nextUntilUnescaped</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">end</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 67</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">escaped</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">false</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 68</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">next</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 69</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">while</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">notEquals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"\n"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 70</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 71</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">end</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">!</SPAN><SPAN class="localvariable">escaped</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 72</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="keyword">break</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 73</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">escaped</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"\\";</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 74</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 75</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 76</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 77</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">readHexNumber</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 78</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="localvariable">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="comment">// skip the 'x'</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 79</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isHexDigit</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 80</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"number"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"atom"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 81</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 82</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">readNumber</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 83</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isDigit</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 84</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"."</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 85</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 86</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isDigit</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 87</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 88</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"e"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"E"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 89</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="localvariable">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 90</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"-"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 91</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 92</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isDigit</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 93</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 94</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"number"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"atom"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 95</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 96</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Read a word, look it up in keywords. If not found, it is a</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine"> 97</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// variable, otherwise it is a keyword of the type found.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 98</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">readWord</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine"> 99</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isWordChar</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">100</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">word</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">get</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">101</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">known</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywords</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">hasOwnProperty</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">word</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywords</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">propertyIsEnumerable</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">word</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">keywords</SPAN><SPAN class="punctuation">[</SPAN><SPAN class="localvariable">word</SPAN><SPAN class="punctuation">]</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">102</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">known</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">?</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">known</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">type</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">known</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">style</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">word</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"variable"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"variable"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">word</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">103</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">104</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">readRegexp</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">105</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">nextUntilUnescaped</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"/"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">106</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">matcher</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="regexp">/[gi]/</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">107</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"regexp"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"regexp"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">108</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">109</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Mutli-line comments are tricky. We want to return the newlines</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">110</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// embedded in them as regular newline tokens, and then continue</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">111</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// returning a comment token for every line of the comment. So</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">112</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// some state has to be saved (inComment) to indicate whether we</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">113</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// are inside a /* */ sequence.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">114</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">readMultilineComment</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variabledef">start</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">115</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">inComment</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">true</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">116</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">maybeEnd</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">start</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"*"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">117</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">while</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="atom">true</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">118</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"\n"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">119</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="keyword">break</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">120</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">121</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"/"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">maybeEnd</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">122</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">inComment</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">false</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">123</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="keyword">break</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">124</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">125</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">maybeEnd</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">next</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"*"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">126</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">127</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"comment"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"comment"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">128</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">129</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">130</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Fetch the next token. Dispatches on first character in the</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">131</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// stream, or first two characters when the first is a slash. The</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">132</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// || things are a silly trick to keep simple cases on a single</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">133</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// line.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">134</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">function</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">135</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">null</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">136</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">var</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variabledef">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">137</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"\n"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">138</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">{</SPAN><SPAN class="property">type</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"newline"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">style</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"whitespace"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">value</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">get</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">139</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">inComment</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">140</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">readMultilineComment</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">call</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">141</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isWhiteSpace</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">142</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isWhiteSpace</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"whitespace"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"whitespace"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">143</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"\""</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"'"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">144</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">nextUntilUnescaped</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"string"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"string"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">145</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="comment">// with punctuation, the type of the token is the symbol itself</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">146</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="regexp">/[\[\]{}\(\),;\:\.]/</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">test</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">147</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"punctuation"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">148</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"0"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"x"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"X"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">149</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">readHexNumber</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">150</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="variable">isDigit</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">151</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">readNumber</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">152</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"/"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">{</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">153</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"*"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">154</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">readMultilineComment</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">call</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">155</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">equals</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"/"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">156</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">nextUntilUnescaped</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="atom">null</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"comment"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"comment"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">157</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">regexp</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">158</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">readRegexp</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">159</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">160</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">          </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isOperatorChar</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"operator"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"operator"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">161</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">162</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isOperatorChar</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">ch</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">163</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">source</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">nextWhile</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">isOperatorChar</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">result</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="string">"operator"</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"operator"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">164</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">else</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">165</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">readWord</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">166</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">167</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="comment">// JavaScript's syntax rules for when a slash might be the start</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">168</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="comment">// of a regexp and when it is just a division operator are kind</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">169</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="comment">// of non-obvious. This decides, based on the current token,</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">170</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="comment">// whether the next token could be a regular expression.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">171</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">if</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">(</SPAN><SPAN class="localvariable">token</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">style</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">!=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"whitespace"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">&amp;&amp;</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">!=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"comment"</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">172</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">        </SPAN><SPAN class="localvariable">this</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">regexp</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">=</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="property">type</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"operator"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">type</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="operator">==</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="string">"keyword c"</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="variable">|</SPAN><SPAN class="variable">|</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">type</SPAN><SPAN class="punctuation">.</SPAN><SPAN class="variable">match</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="regexp">/[\[{}\(,;:]/</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">173</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">      </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">token</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">174</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">175</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">176</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// Wrap it in an iterator. The state (regexp and inComment) is</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">177</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// exposed because a parser will need to save it when making a</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">178</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="comment">// copy of its state.</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" executable="true" exechecked="true"><A class="sourceLine">179</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">    </SPAN><SPAN class="keyword">return</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="punctuation">{</SPAN><SPAN class="property">next</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="localvariable">next</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">regexp</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">true</SPAN><SPAN class="punctuation">,</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="property">inComment</SPAN><SPAN class="punctuation">:</SPAN><SPAN class="whitespace"> </SPAN><SPAN class="atom">false</SPAN><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">180</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace">  </SPAN><SPAN class="punctuation">}</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">181</A><SPAN class="sourceRowText"><SPAN class="punctuation">}</SPAN><SPAN class="punctuation">(</SPAN><SPAN class="punctuation">)</SPAN><SPAN class="punctuation">;</SPAN><SPAN class="whitespace"/><SPAN class="whitespace">   </SPAN></SPAN></DIV><DIV class="sourceRow" exechecked="true"><A class="sourceLine">182</A><SPAN class="sourceRowText"><SPAN class="whitespace"/><SPAN class="whitespace"> </SPAN></SPAN></DIV></DIV></DIV>